/*
 * Copyright 2005-2013 evolution.com. All rights reserved.
 */
package com.evolution.warlock.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
/**
 * Entity - 民族
 * 
 * @author EVOLUTION Team
 * @version 1.0
 */
@Entity
@Table(name = "ev_static_ethnic")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "ev_static_ethnic_sequence")
public class Ethnic extends BaseEntity {

	private static final long serialVersionUID = -542346669144242417L;

	/** 民族名 */
	private String name;
	
	/** 排序 */
	private String periodCd;
	
	/** 犯罪分子 */
	private Set<CriminalMember> members = new HashSet<CriminalMember>(); 
	
	
	@Length(max = 20)
	public String getPeriodCd() {
		return periodCd;
	}


	public void setPeriodCd(String periodCd) {
		this.periodCd = periodCd;
	}


	/**
	 * 
	 */
	@NotEmpty
	@Length(max = 20)
	@Column(nullable = false)
	public String getName() {
		return name;
	}
	
	
	/**
	 * 
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	
	@OneToMany(mappedBy = "ethnic", fetch = FetchType.LAZY)
	public Set<CriminalMember> getMembers() {
		return members;
	}

	public void setMembers(Set<CriminalMember> members) {
		this.members = members;
	}
}
